#ifndef OBJA_H
#define OBJA_H

#include <QObject>

class ObjA : public QObject
{
    Q_OBJECT
    Q_PROPERTY(int iv READ getIv NOTIFY ivChanged)
    Q_PROPERTY(float fv MEMBER fv WRITE setFv NOTIFY fvChanged)
    Q_PROPERTY(QString sv MEMBER sv NOTIFY svChanged)
public:
    explicit ObjA(QObject *parent = nullptr);

    int iv = 0;
    float fv = 0;
    QString sv;

    int getIv() {return iv;}
    void setFv(float f);

signals:
    // 信号顺序需要跟Q_PROPERTY对应属性的一致
    void ivChanged();
    void fvChanged();
    void svChanged();
};

#endif // OBJA_H
